<script setup lang="ts">
import CommonDialog from "@/newComponents/CommonDialog.vue";
const dialogRef = ref();

// 暴露 open 方法，让爷爷组件可以调用
const open = (row: any) => {
  dialogRef.value?.open(row);
};

defineExpose({ open });
</script>

<template>
  <common-dialog v-bind="{ ...$props, ...$attrs }" ref="dialogRef">
    <template #dialogFormContent="{ formData }">
      <el-form-item label="网站名称" prop="name" :rules="{ required: true }">
        <el-input v-model="formData.name" placeholder="请输入网站名称" />
      </el-form-item>
      <el-form-item label="logo" prop="logo" :rules="{ required: true }">
        <single-image-upload v-model="formData.logo" />
      </el-form-item>
      <el-form-item label="地址" prop="address" :rules="{ required: true }">
        <el-input v-model="formData.address" placeholder="请输入网站地址" />
      </el-form-item>
      <el-form-item label="描述" prop="description">
        <el-input v-model="formData.description" placeholder="请输入网站描述" />
      </el-form-item>
      <el-form-item label="状态" prop="status">
        <el-select v-model="formData.status" placeholder="请选择状态">
          <el-option label="审核通过" value="0"></el-option>
          <el-option label="审核未通过" value="1"></el-option>
          <el-option label="未审核" value="2"></el-option>
        </el-select>
      </el-form-item>
    </template>
  </common-dialog>
</template>

<style scoped lang="scss"></style>
